package grape.house.rest.areainterval.form;
import grape.common.rest.form.BaseForm;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.ScriptAssert;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
/**
 * <p>
 * 面积区间表
 * </p>
 *
 * @author yangwei
 * @since 2020-09-17
 */
@ScriptAssert(script = "!!_this.areaMin || !!_this.areaMax",message = "最小值和最大值不能同时为空",lang = "javascript")
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="面积区间添加表单对象")
public class AreaIntervalCreateForm extends BaseForm {

    private static final long serialVersionUID = 1L;

    @NotEmpty(message="名称不能为空")
    @ApiModelProperty(value = "名称",required = true)
    private String name;

    @ApiModelProperty(value = "最小值，不填为最大值以下")
    private Integer areaMin;

    @ApiModelProperty(value = "最大值，不填为最小值以上，两个不能都为空")
    private Integer areaMax;

    @NotNull(message="排序不能为空")
    @ApiModelProperty(value = "排序",required = true)
    private Integer seq;



}
